package io.adrainty.bolee.insurance.models.entity;

import cn.hutool.core.util.DesensitizedUtil;
import io.adrainty.bolee.file.models.entity.FileEntity;
import io.adrainty.bolee.framework.commons.basic.BaseEntity;
import io.adrainty.bolee.framework.commons.basic.EnableEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.io.Serial;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author AdRainty
 * @version V1.0.0
 * @since 2025/8/24 下午11:40
 */

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(description = "客户关系")
public class CustomerRelationEntity extends BaseEntity {

    @Serial
    private static final long serialVersionUID = -4604181448146891932L;

    @Schema(description = "关系人ID")
    private Long customerId;

    @Schema(description = "关系")
    private String relation;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "身份证号码")
    private String identityCard;

    @Schema(description = "公司")
    private String companyNo;

    @Schema(description = "排序")
    private Integer sortNo;

    @Schema(description = "社保状态（0有 1无）")
    private String socialSecurity;

    @Schema(description = "城市编号")
    private String cityNo;

    @Schema(description = "收入")
    private BigDecimal income;

    @Schema(description = "文件VO对象")
    private List<FileEntity> fileVOs;

    @Schema(description = "批量操作：主键ID")
    private String[] checkedIds;

    @Schema(description = "关系列表")
    private String[] relations;

    @Schema(description = "性别")
    private String sex;

    @Schema(description = "年龄")
    private Integer age;

    @Schema(description = "数据状态")
    private EnableEnum dataState;

    /**
     * 脱敏数据
     */
    public void desensitize() {
        this.identityCard = DesensitizedUtil.idCardNum(this.identityCard, 3, 2);
    }

}
